/*
 * $Id: mirror.h,v 1.12.6.2 Broadcom SDK $
 * 
 * $Copyright: Copyright 2011 Broadcom Corporation.
 * This program is the proprietary software of Broadcom Corporation
 * and/or its licensors, and may only be used, duplicated, modified
 * or distributed pursuant to the terms and conditions of a separate,
 * written license agreement executed between you and Broadcom
 * (an "Authorized License").  Except as set forth in an Authorized
 * License, Broadcom grants no license (express or implied), right
 * to use, or waiver of any kind with respect to the Software, and
 * Broadcom expressly reserves all rights in and to the Software
 * and all intellectual property rights therein.  IF YOU HAVE
 * NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE
 * IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
 * ALL USE OF THE SOFTWARE.  
 *  
 * Except as expressly set forth in the Authorized License,
 *  
 * 1.     This program, including its structure, sequence and organization,
 * constitutes the valuable trade secrets of Broadcom, and you shall use
 * all reasonable efforts to protect the confidentiality thereof,
 * and to use this information only in connection with your use of
 * Broadcom integrated circuit products.
 *  
 * 2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS
 * PROVIDED "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
 * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
 * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE.  BROADCOM SPECIFICALLY
 * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
 * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
 * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
 * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING
 * OUT OF USE OR PERFORMANCE OF THE SOFTWARE.
 * 
 * 3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL
 * BROADCOM OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL,
 * INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER
 * ARISING OUT OF OR IN ANY WAY RELATING TO YOUR USE OF OR INABILITY
 * TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF
 * THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR USD 1.00,
 * WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING
 * ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.$
 * 
 * DO NOT EDIT THIS FILE!
 * This file is auto-generated.
 * Edits to this file will be lost when it is regenerated.
 */

#ifndef __BCMX_MIRROR_H__
#define __BCMX_MIRROR_H__

#include <bcm/types.h>
#include <bcmx/bcmx.h>
#include <bcmx/lplist.h>
#include <bcm/mirror.h>

typedef bcm_mirror_destination_t bcmx_mirror_destination_t;

/* Initialize the mirror destination structure. */
extern void bcmx_mirror_destination_t_init(
    bcmx_mirror_destination_t *mirror_dest);

/* Initialize the mirroring module to its initial configuration. */
extern int bcmx_mirror_init(void);

/* Create a mirror (destination, encapsulation) pair. */
extern int bcmx_mirror_destination_create(
    bcmx_mirror_destination_t *mirror_dest);

/* Get  mirror (destination, encapsulation) pair. */
extern int bcmx_mirror_destination_get(
    bcm_gport_t mirror_dest_id, 
    bcmx_mirror_destination_t *mirror_dest);

/* Destroy a mirror (destination, encapsulation) pair. */
extern int bcmx_mirror_destination_destroy(
    bcm_gport_t mirror_dest_id);

/* Set the current mirroring mode for the device. */
extern int bcmx_mirror_mode_set(
    int mode);

/* Get the current mirroring mode for the device. */
extern int bcmx_mirror_mode_get(
    int *mode);

/* Set the mirror-to port for the device. */
extern int bcmx_mirror_to_set(
    bcmx_lport_t port);

/* Get the mirror-to port for the device. */
extern int bcmx_mirror_to_get(
    bcmx_lport_t *port);

/* Enable or Disable ingress mirroring for a port on the device. */
extern int bcmx_mirror_ingress_set(
    bcmx_lport_t port, 
    int val);

/* 
 * Get the ingress mirroring enabled/disabled status for a port on the
 * device.
 */
extern int bcmx_mirror_ingress_get(
    bcmx_lport_t port, 
    int *val);

/* Enable or Disable egress mirroring for a port on the device. */
extern int bcmx_mirror_egress_set(
    bcmx_lport_t port, 
    int val);

/* 
 * Get the egress mirroring enabled/disabled status for a port on the
 * device.
 */
extern int bcmx_mirror_egress_get(
    bcmx_lport_t port, 
    int *val);

/* Enable or Disable mirroring preserve format control. */
extern int bcmx_mirror_pfmt_set(
    int val);

/* Get the current preserve format control setting. */
extern int bcmx_mirror_pfmt_get(
    int *val);

/* Set mirror-to ports for a port. */
extern int bcmx_mirror_fabric_list_set(
    bcmx_lport_t port, 
    bcmx_lplist_t lplist);

/* Get mirror-to ports for a port. */
extern int bcmx_mirror_fabric_list_get(
    bcmx_lport_t port, 
    bcmx_lplist_t *lplist);

/* Set mirroring configuration for a port. */
extern int bcmx_mirror_port_set(
    bcmx_lport_t port, 
    bcmx_lport_t dest_port, 
    uint32 flags);

/* Get mirroring configuration for a port. */
extern int bcmx_mirror_port_get(
    bcmx_lport_t port, 
    bcmx_lport_t *dest_port, 
    uint32 *flags);

/* Set VLAN for egressing mirrored packets on a port (RSPAN). */
extern int bcmx_mirror_vlan_set(
    bcmx_lport_t port, 
    uint16 tpid, 
    uint16 vlan);

/* Get VLAN for egressing mirrored packets on a port (RSPAN). */
extern int bcmx_mirror_vlan_get(
    bcmx_lport_t port, 
    uint16 *tpid, 
    uint16 *vlan);

/* Add mirroring destination to a port */
extern int bcmx_mirror_port_dest_add(
    bcmx_lport_t port, 
    uint32 flags, 
    bcm_gport_t mirror_dest_id);

/* Delete mirroring destination from a port */
extern int bcmx_mirror_port_dest_delete(
    bcmx_lport_t port, 
    uint32 flags, 
    bcm_gport_t mirror_dest_id);

/* Delete all mirroring destinations from a port */
extern int bcmx_mirror_port_dest_delete_all(
    bcmx_lport_t port, 
    uint32 flags);

/* Get port mirroring destinations */
extern int bcmx_mirror_port_dest_get(
    bcmx_lport_t port, 
    uint32 flags, 
    int mirror_dest_size, 
    bcm_gport_t *mirror_dest, 
    int *mirror_dest_count);

#endif /* __BCMX_MIRROR_H__ */
